home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / !runtime / prims.c < prev    next >
Encoding:
Text File  |  1997-08-18  |  10.1 KB  |  546 lines  |  [TEXT/Moml]

  1. // 22Jul97 e
  2.  
  3. #include "mlvalues.h"
  4. #include "prims.h"
  5.  
  6. extern value compare();
  7. extern value equal();
  8. extern value notequal();
  9. extern value lessthan();
  10. extern value lessequal();
  11. extern value greaterthan();
  12. extern value greaterequal();
  13. extern value extern_val();
  14. extern value extern_compact_val();
  15. extern value format_float();
  16. extern value float_of_string();
  17. extern value exp_float();
  18. extern value log_float();
  19. extern value sqrt_float();
  20. extern value power_float();
  21. extern value sin_float();
  22. extern value cos_float();
  23. extern value tan_float();
  24. extern value asin_float();
  25. extern value acos_float();
  26. extern value atan_float();
  27. extern value atan2_float();
  28. extern value gc_stat();
  29. extern value gc_get();
  30. extern value gc_set();
  31. extern value gc_minor();
  32. extern value gc_major();
  33. extern value gc_full_major();
  34. extern value hash_univ_param();
  35. extern value intern_val();
  36. extern value int_of_string();
  37. extern value format_int();
  38. extern value open_descriptor();
  39. extern value channel_descriptor();
  40. extern value channel_size();
  41. extern value flush();
  42. extern value output_char();
  43. extern value output_int();
  44. extern value output();
  45. extern value seek_out();
  46. extern value pos_out();
  47. extern value close_out();
  48. extern value input_char();
  49. extern value input_int();
  50. extern value input();
  51. extern value seek_in();
  52. extern value pos_in();
  53. extern value close_in();
  54. extern value input_scan_line();
  55. extern value get_next_char();
  56. extern value start_interp();
  57. extern value realloc_global();
  58. extern value static_alloc();
  59. extern value static_free();
  60. extern value static_resize();
  61. extern value obj_is_block();
  62. extern value obj_block();
  63. extern value available_primitives();
  64. extern value parse_engine();
  65. extern value create_string();
  66. extern value compare_strings();
  67. extern value blit_string();
  68. extern value fill_string();
  69. extern value is_printable();
  70. extern value sys_exit();
  71. extern value sys_open();
  72. extern value sys_close();
  73. extern value sys_remove();
  74. extern value sys_rename();
  75. extern value sys_chdir();
  76. extern value sys_getenv();
  77. extern value sys_system_command();
  78. extern value sys_catch_break();
  79.  
  80. extern value sml_equal();
  81. extern value sml_not_equal();
  82. extern value sml_system();
  83. extern value sml_abs_int();
  84. extern value sml_floor();
  85. extern value sml_ceil();
  86. extern value sml_round();
  87. extern value sml_trunc();
  88. extern value sml_abs_real();
  89. extern value sml_sqrt();
  90. extern value sml_sin();
  91. extern value sml_cos();
  92. extern value sml_exp();
  93. extern value sml_ln();
  94. extern value sml_int_of_string();
  95. extern value sml_concat();
  96. extern value sml_chr();
  97. extern value sml_ord();
  98. extern value sml_float_of_string();
  99. extern value sml_string_of_int();
  100. extern value sml_string_of_float();
  101. extern value sml_makestring_of_char();
  102. extern value sml_makestring_of_string();
  103. extern value sml_getrealtime();
  104. extern value sml_getrutime();
  105. extern value sml_errno();
  106. extern value sml_getdir();
  107. extern value sml_mkdir();
  108. extern value sml_rmdir();
  109. extern value sml_opendir();
  110. extern value sml_rewinddir();
  111. extern value sml_readdir();
  112. extern value sml_closedir();
  113. extern value sml_isdir();
  114. extern value sml_modtime();
  115. extern value sml_settime();
  116. extern value sml_access();
  117. extern value sml_tmpnam();
  118. extern value sml_errormsg();
  119. extern value sml_asin();
  120. extern value sml_acos();
  121. extern value sml_atan2();
  122. extern value sml_pow();
  123. extern value sml_localtime();
  124. extern value sml_gmtime();
  125. extern value sml_mktime();
  126. extern value sml_asctime();
  127. extern value sml_strftime();
  128. extern value sml_general_string_of_float();
  129. extern value sml_filesize();
  130. extern value sml_int_of_hex();
  131. extern value sml_word_of_hex();
  132. extern value sml_word_of_dec();
  133. extern value sml_hexstring_of_word();
  134. extern value sml_sinh();
  135. extern value sml_cosh();
  136. extern value sml_tanh();
  137. extern value sml_realpath();
  138. extern value sml_uname();
  139. extern value sml_islink();
  140. extern value sml_readlink();
  141. extern value sml_devinode();
  142.  
  143. extern value md5sum();
  144.  
  145. extern value get_timer();
  146. extern value beg_timer();
  147. extern value end_timer();
  148. extern value clr_timer();
  149.  
  150. extern value mac_OSACompile();
  151. extern value mac_OSAExecute();
  152. extern value mac_OSADispose();
  153. extern value mac_OSADisplay();
  154. extern value mac_OSAScriptError();
  155.  
  156. extern value dump_image();
  157. extern value set_line_width();
  158. extern value draw_arc();
  159. extern value create_image();
  160. extern value draw_char();
  161. extern value text_size();
  162. extern value wait_event();
  163. extern value fill_poly();
  164. extern value make_image();
  165. extern value fill_rect();
  166. extern value plot();
  167. extern value draw_image();
  168. extern value set_color();
  169. extern value sound();
  170. extern value lineto();
  171. extern value moveto();
  172. extern value clear_graph();
  173. extern value blit_image();
  174. extern value draw_string();
  175. extern value current_point();
  176. extern value size_x();
  177. extern value size_y();
  178. extern value point_color();
  179. extern value fill_arc();
  180. extern value close_graph();
  181. extern value set_font();
  182. extern value open_graph();
  183. extern value set_text_size();
  184.  
  185. c_primitive cprim[] = {
  186.   compare,
  187.   equal,
  188.   notequal,
  189.   lessthan,
  190.   lessequal,
  191.   greaterthan,
  192.   greaterequal,
  193.   extern_val,
  194.   extern_compact_val,
  195.   format_float,
  196.   float_of_string,
  197.   exp_float,
  198.   log_float,
  199.   sqrt_float,
  200.   power_float,
  201.   sin_float,
  202.   cos_float,
  203.   tan_float,
  204.   asin_float,
  205.   acos_float,
  206.   atan_float,
  207.   atan2_float,
  208.   gc_stat,
  209.   gc_get,
  210.   gc_set,
  211.   gc_minor,
  212.   gc_major,
  213.   gc_full_major,
  214.   hash_univ_param,
  215.   intern_val,
  216.   int_of_string,
  217.   format_int,
  218.   open_descriptor,
  219.   channel_descriptor,
  220.   channel_size,
  221.   flush,
  222.   output_char,
  223.   output_int,
  224.   output,
  225.   seek_out,
  226.   pos_out,
  227.   close_out,
  228.   input_char,
  229.   input_int,
  230.   input,
  231.   seek_in,
  232.   pos_in,
  233.   close_in,
  234.   input_scan_line,
  235.   get_next_char,
  236.   start_interp,
  237.   realloc_global,
  238.   static_alloc,
  239.   static_free,
  240.   static_resize,
  241.   obj_is_block,
  242.   obj_block,
  243.   available_primitives,
  244.   parse_engine,
  245.   create_string,
  246.   compare_strings,
  247.   blit_string,
  248.   fill_string,
  249.   is_printable,
  250.   sys_exit,
  251.   sys_open,
  252.   sys_close,
  253.   sys_remove,
  254.   sys_rename,
  255.   sys_chdir,
  256.   sys_getenv,
  257.   sys_system_command,
  258.   sys_catch_break,
  259.  
  260.   sml_equal,
  261.   sml_not_equal,
  262.   sml_system,
  263.   sml_abs_int,
  264.   sml_floor,
  265.   sml_ceil,
  266.   sml_round,
  267.   sml_trunc,
  268.   sml_abs_real,
  269.   sml_sqrt,
  270.   sml_sin,
  271.   sml_cos,
  272.   sml_exp,
  273.   sml_ln,
  274.   sml_int_of_string,
  275.   sml_concat,
  276.   sml_chr,
  277.   sml_ord,
  278.   sml_float_of_string,
  279.   sml_string_of_int,
  280.   sml_string_of_float,
  281.   sml_makestring_of_char,
  282.   sml_makestring_of_string,
  283.   sml_getrealtime,
  284.   sml_getrutime,
  285.   sml_errno,
  286.   sml_getdir,
  287.   sml_mkdir,
  288.   sml_rmdir,
  289.   sml_opendir,
  290.   sml_rewinddir,
  291.   sml_readdir,
  292.   sml_closedir,
  293.   sml_isdir,
  294.   sml_modtime,
  295.   sml_settime,
  296.   sml_access,
  297.   sml_tmpnam,
  298.   sml_errormsg,
  299.   sml_asin,
  300.   sml_acos,
  301.   sml_atan2,
  302.   sml_pow,
  303.   sml_localtime,
  304.   sml_gmtime,
  305.   sml_mktime,
  306.   sml_asctime,
  307.   sml_strftime,
  308.   sml_general_string_of_float,
  309.   sml_filesize,
  310.   sml_int_of_hex,
  311.   sml_word_of_hex,
  312.   sml_word_of_dec,
  313.   sml_hexstring_of_word,
  314.   sml_sinh,
  315.   sml_cosh,
  316.   sml_tanh,
  317.   sml_realpath,
  318.   sml_uname,
  319.   sml_islink,
  320.   sml_readlink,
  321.   sml_devinode,
  322.   
  323.   md5sum,
  324.  
  325.   get_timer,
  326.   beg_timer,
  327.   end_timer,
  328.   clr_timer,
  329.  
  330.   mac_OSACompile,
  331.   mac_OSAExecute,
  332.   mac_OSADispose,
  333.   mac_OSADisplay,
  334.   mac_OSAScriptError,
  335.  
  336.   dump_image,
  337.   set_line_width,
  338.   draw_arc,
  339.   create_image,
  340.   draw_char,
  341.   text_size,
  342.   wait_event,
  343.   fill_poly,
  344.   make_image,
  345.   fill_rect,
  346.   plot,
  347.   draw_image,
  348.   set_color,
  349.   sound,
  350.   lineto,
  351.   moveto,
  352.   clear_graph,
  353.   blit_image,
  354.   draw_string,
  355.   current_point,
  356.   size_x,
  357.   size_y,
  358.   point_color,
  359.   fill_arc,
  360.   close_graph,
  361.   set_font,
  362.   open_graph,
  363.   set_text_size,
  364.   0 };
  365.  
  366. char * names_of_cprim[] = {
  367.   "compare",
  368.   "equal",
  369.   "notequal",
  370.   "lessthan",
  371.   "lessequal",
  372.   "greaterthan",
  373.   "greaterequal",
  374.   "extern_val",
  375.   "extern_compact_val",
  376.   "format_float",
  377.   "float_of_string",
  378.   "exp_float",
  379.   "log_float",
  380.   "sqrt_float",
  381.   "power_float",
  382.   "sin_float",
  383.   "cos_float",
  384.   "tan_float",
  385.   "asin_float",
  386.   "acos_float",
  387.   "atan_float",
  388.   "atan2_float",
  389.   "gc_stat",
  390.   "gc_get",
  391.   "gc_set",
  392.   "gc_minor",
  393.   "gc_major",
  394.   "gc_full_major",
  395.   "hash_univ_param",
  396.   "intern_val",
  397.   "int_of_string",
  398.   "format_int",
  399.   "open_descriptor",
  400.   "channel_descriptor",
  401.   "channel_size",
  402.   "flush",
  403.   "output_char",
  404.   "output_int",
  405.   "output",
  406.   "seek_out",
  407.   "pos_out",
  408.   "close_out",
  409.   "input_char",
  410.   "input_int",
  411.   "input",
  412.   "seek_in",
  413.   "pos_in",
  414.   "close_in",
  415.   "input_scan_line",
  416.   "get_next_char",
  417.   "start_interp",
  418.   "realloc_global",
  419.   "static_alloc",
  420.   "static_free",
  421.   "static_resize",
  422.   "obj_is_block",
  423.   "obj_block",
  424.   "available_primitives",
  425.   "parse_engine",
  426.   "create_string",
  427.   "compare_strings",
  428.   "blit_string",
  429.   "fill_string",
  430.   "is_printable",
  431.   "sys_exit",
  432.   "sys_open",
  433.   "sys_close",
  434.   "sys_remove",
  435.   "sys_rename",
  436.   "sys_chdir",
  437.   "sys_getenv",
  438.   "sys_system_command",
  439.   "sys_catch_break",
  440.  
  441.   "sml_equal",
  442.   "sml_not_equal",
  443.   "sml_system",
  444.   "sml_abs_int",
  445.   "sml_floor",
  446.   "sml_ceil",
  447.   "sml_round",
  448.   "sml_trunc",
  449.   "sml_abs_real",
  450.   "sml_sqrt",
  451.   "sml_sin",
  452.   "sml_cos",
  453.   "sml_exp",
  454.   "sml_ln",
  455.   "sml_int_of_string",
  456.   "sml_concat",
  457.   "sml_chr",
  458.   "sml_ord",
  459.   "sml_float_of_string",
  460.   "sml_string_of_int",
  461.   "sml_string_of_float",
  462.   "sml_makestring_of_char",
  463.   "sml_makestring_of_string",
  464.   "sml_getrealtime",
  465.   "sml_getrutime",
  466.   "sml_errno",
  467.   "sml_getdir",
  468.   "sml_mkdir",
  469.   "sml_rmdir",
  470.   "sml_opendir",
  471.   "sml_rewinddir",
  472.   "sml_readdir",
  473.   "sml_closedir",
  474.   "sml_isdir",
  475.   "sml_modtime",
  476.   "sml_settime",
  477.   "sml_access",
  478.   "sml_tmpnam",
  479.   "sml_errormsg",
  480.   "sml_asin",
  481.   "sml_acos",
  482.   "sml_atan2",
  483.   "sml_pow",
  484.   "sml_localtime",
  485.   "sml_gmtime",
  486.   "sml_mktime",
  487.   "sml_asctime",
  488.   "sml_strftime",
  489.   "sml_general_string_of_float",
  490.   "sml_filesize",
  491.   "sml_int_of_hex",
  492.   "sml_word_of_hex",
  493.   "sml_word_of_dec",
  494.   "sml_hexstring_of_word",
  495.   "sml_sinh",
  496.   "sml_cosh",
  497.   "sml_tanh",
  498.   "sml_realpath",
  499.   "sml_uname",
  500.   "sml_islink",
  501.   "sml_readlink",
  502.   "sml_devinode",
  503.  
  504.   "md5sum",
  505.  
  506.   "get_timer",
  507.   "beg_timer",
  508.   "end_timer",
  509.   "clr_timer",
  510.  
  511.   "mac_OSACompile",
  512.   "mac_OSAExecute",
  513.   "mac_OSADispose",
  514.   "mac_OSADisplay",
  515.   "mac_OSAScriptError",
  516.  
  517.   "dump_image",
  518.   "set_line_width",
  519.   "draw_arc",
  520.   "create_image",
  521.   "draw_char",
  522.   "text_size",
  523.   "wait_event",
  524.   "fill_poly",
  525.   "make_image",
  526.   "fill_rect",
  527.   "plot",
  528.   "draw_image",
  529.   "set_color",
  530.   "sound",
  531.   "lineto",
  532.   "moveto",
  533.   "clear_graph",
  534.   "blit_image",
  535.   "draw_string",
  536.   "current_point",
  537.   "size_x",
  538.   "size_y",
  539.   "point_color",
  540.   "fill_arc",
  541.   "close_graph",
  542.   "set_font",
  543.   "open_graph",
  544.   "set_text_size",
  545.   (char *) 0 };
  546.